import Vue from "vue";

// 年份过滤器
Vue.filter("YearDate", function (timestamp) {
  const date = new Date(timestamp);
  const year = date.getFullYear();
  return year;
});
// 月份过滤器
Vue.filter("MonthDate", function (timestamp) {
  const date = new Date(timestamp);
  const month = date.getMonth() + 1 + "月";
  return month;
});
// 运营订单表订单类型
Vue.filter("OrderType", function (type) {
  const Name = type == '1'?'正式订单':'运营补单'
  return Name;
});
// 运营订单表订单状态
Vue.filter("OrderStatus", function (type) {
  const Name = type == '1'?'普通订单':type == '2'?'退款订单':'售后订单'
  return Name;
});
// 运营订单表订单状态tag
Vue.filter("OrderStatusTag", function (type) {
  const TypeName = ['','success','warning','info',]
  return TypeName[Number(type)];
});
// 供应链分单订单操作类型名字
Vue.filter("OrderOperateName", function (type) {
  const NameArr = ['未分组','延时报备','按时发货','报备完成']
  return NameArr[Number(type - 1)];
});
// 供应链分单订单操作类型状态颜色
Vue.filter("OrderOperateType", function (type) {
  const TypeName = ['','info','warning','success']
  return TypeName[Number(type - 1)];
});